package com.css.zfzx.fwsjcj.modules.basecontroller.controller;

import com.css.bpm.platform.api.local.PlatformAPI;
import com.css.bpm.platform.base.response.RestResponse;
import com.css.bpm.platform.org.dept.repository.entity.DeptEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/fw/org")
@Slf4j
public class GetOrgController {
    @GetMapping("org")
    public RestResponse getOrg() {
        List<DeptEntity> allDepts = PlatformAPI.getOrgAPI().getDeptAPI().getAllDepts();
        return RestResponse.succeed(allDepts);
    }

}
